package com.winchain.chainbill.basic.cus.controller;

import com.shell.bee.base.annotation.Logging;
import com.shell.bee.mvc.controller.BaseController;
import com.shell.bee.persistence.model.PageLimit;
import com.shell.framework.utils.CommonDataUtil;
import com.winchain.chainbill.basic.cus.po.CusRec;
import com.winchain.chainbill.basic.cus.service.CusRecService;
import com.winchain.chainbill.basic.cus.vo.BasCustomerVo;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CustomerController extends BaseController {
	@Autowired
	CusRecService basCusService;

	@RequestMapping
	@ResponseBody
	@Logging(module = "��������", methods = "��������������")
	public List<BasCustomerVo> findCustomers(PageLimit limit, BasCustomerVo customer) throws Exception {
		return this.basCusService.findCustomersByPage(limit, customer);
	}

	@RequestMapping
	@ResponseBody
	@Logging(module = "��������", methods = "����������������������")
	public List<BasCustomerVo> findRelCus(PageLimit limit, BasCustomerVo customer) throws Exception {
		return this.basCusService.findRelCussByPage(limit, customer);
	}

	@RequestMapping
	@ResponseBody
	@Logging(module = "��������", methods = "����������������������")
	public CusRec getCurCustomer() throws Exception {
		String entId = CommonDataUtil.getCurEntId();
		return (CusRec) this.basCusService.selectByKey(entId);
	}
}
